class CreatePropertyPatternPropertyAttributes < ActiveRecord::Migration
  def change
    create_table :property_pattern_property_attributes, :force => true do |t|
      t.references :property_pattern_property
      t.string :presentation, :null => true, :limit => 35
      t.string :value_type, :null => true, :limit => 10, :default => 'value'

      t.integer :parent_id, :limit => 4
      t.integer :lft, :limit => 11, :null => false
      t.integer :rgt, :limit => 11, :null => false
    end

    add_index :property_pattern_property_attributes, :property_pattern_property_id, :name => "property_pattern_property_id_index"
  end
end
